package com.itheima.mm.mapper;

import com.itheima.mm.entity.TagPageQueryParams;
import com.itheima.mm.pojo.Course;
import com.itheima.mm.pojo.Tag;
import com.itheima.mm.vo.TagVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Description TagMapper
 * @Author xiao
 * @Date 2024-06-26
 */
@Mapper
public interface TagMapper {

    //试题预览有关
    List<Tag> findListByQuestionId(Integer id);



 @Select("select * from t_tag where course_id = #{courseId}")
   List<Tag> findListByCourseId(Integer courseId);
//增加标签
    Integer addTag(Tag tag);
    List<TagVO> findByCondition(TagPageQueryParams queryParams);
    /**
     * 删除标签
     * @param id
     * @return
     */
    Integer deleteTag(Integer id);
 //更新学科标签
 void update(Tag tag);
 //禁用学科目录
 @Update("UPDATE t_tag SET status = #{status} WHERE id = #{id}")
 int updateTagStatus(@Param("id") Integer id, @Param("status") Integer status);
}

